package com.example.teacherservice.dto;

import lombok.Data;
import java.sql.Timestamp;

/**
 * 教师-班级关系增强版DTO
 * 包含卡片展示所需的完整信息
 */
@Data
public class ClassRelationDTO {
    private Long classId;          // 班级ID
    private String className;     // 班级名称
    private String teaName;       // 班主任姓名
    private Integer studentCount; // 学生人数
    private Timestamp createTime; // 创建时间
    private Timestamp updateTime; // 最后更新时间
    private String classCode;     // 班级代码（自动生成）
    private Integer courseCount;  // 关联课程数量
    private Integer status;       // 状态：1-活跃，0-已结束
    private String description;   // 班级描述（可选）

    // 全参数构造函数
    public ClassRelationDTO(Long classId, String className, String teaName,
                            Integer studentCount, Timestamp createTime,
                            Timestamp updateTime, Integer courseCount,
                            Integer status) {
        this.classId = classId;
        this.className = className;
        this.teaName = teaName;
        this.studentCount = studentCount;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.classCode = "CLS-" + String.format("%04d", classId);
        this.courseCount = courseCount;
        this.status = status;
        this.description = className + "班级";
    }
}